package com.example.demo.controller.zl;

import com.example.demo.entity.PermissionRole;
import com.example.demo.service.zl.PermissionRoleService;
import com.example.demo.service.zl.PermissionRoleServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api
@RestController
public class PermissionRoleCOntroller {
    @Autowired
// 注入服务
    PermissionRoleService permissionRoleService;
    @RequestMapping(value = "all66" , method = RequestMethod.POST)
    @ApiOperation("查询")
    public List<PermissionRole> all66(){
        List<PermissionRole> permissionRoleList= permissionRoleService.all66();
        return permissionRoleList;
    }

    @RequestMapping(value = "add66",method =RequestMethod.POST)
    @ApiOperation("添加")
    public List<PermissionRole>insert9(int sysRoleId, int sysPermissionId){
        List<PermissionRole> permissionRoleList=permissionRoleService.insert9 (sysRoleId,sysPermissionId);
        return permissionRoleList;
    }
    @RequestMapping(value = "delete9",method =RequestMethod.POST)
    @ApiOperation("删除")
    public int delete9(int id){
        int  delete9= permissionRoleService.delete9(id);
        return delete9;
    }
    @RequestMapping(value = "update9",method =RequestMethod.POST)
    @ApiOperation("修改")
    public List<PermissionRole> update9(int sysRoleId, int sysPermissionId) {
        List<PermissionRole> permissionRoleList = permissionRoleService.update9(sysRoleId,sysPermissionId);
        return permissionRoleList;

    }

}
